import { request } from './axios'

//网路工具类
export type Options<IQueryParams, IRequestBody> = {
  title?: string;
  apiHost?: string,
  url: string;
  method: 'GET' | 'POST' | 'DELETE';
  queryParams?: IQueryParams | null;
  requestBody?: IRequestBody | null;
}

export const execute = <T = any, IQueryParams = any, IRequestBody = any>(options: Options<IQueryParams, IRequestBody>): Promise<T> => {
  return request<T>(options)
}
